<div class="hbox hbox-auto-xs hbox-auto-sm" ng-init="
    app.settings.asideFolded = false; 
    app.settings.asideDock = false;
  ">
	<!-- main -->
	<div class="container">

		<div class="userRole-hred">
			<div class="row">
				<div class="col-sm-12 col-xs-12" style="padding: 0px;">
					<p style="padding: 20px; font-size: 18px; border-bottom: 1px solid #8B8E99;margin-bottom: 0px;">角色管理</p>
				</div>
			</div>
			<div class="so" style="padding: 20px;">
				<form class="form-inline" role="form">
					  <div class="form-group">
					    	<label for="inputsojsmc3" class="control-label">角色名称：</label>
					      <input type="text" class="form-control" id="inputsojsmc3" ng-model="queryParam.name">
					  </div>
					  <div class="form-group" style="margin-left: 10px;">
					   		<label for="inputsojsmc3" class="control-label">角色编号：</label>
					      <input type="text" class="form-control" id="inputsojsmc3" ng-model="queryParam.code">
					  </div>
					   <div class="form-group" style="margin-left: 20px;">
					      <button type="button" class="btn btn-primary" ng-click="query()">搜索</button>
					  </div>
				</form>
			</div>
		</div>

		<div class="userRole-body">

			<div class="getRole">
				<table class="table table-hover">
					<tr>
						<td colspan="5">
							<button type="button" class="btn btn-default" data-toggle="modal" data-target="#roleModal"
								ng-click="setAddRole()">
								添加角色
							</button>
						</td>
					</tr>
					<tr>
						<th>角色ID标识</th>
						<th>角色名称</th>
						<th>角色编号</th>
						<th>角色描述</th>
						<th>操作</th>
					</tr>
					<tr ng-repeat="roles in roleList">
						<td>{{roles.id}}</td>
						<td>{{roles.name}}</td>
						<td>{{roles.code}}</td>
						<td>{{roles.desc}}</td>
						<td>
							<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#roleModal"
								ng-click="allotRoleRights(roles.id)">
								分配权限
							</button>
							<button type="button" class="btn btn-success" data-toggle="modal" data-target="#roleModal"
								ng-click="edit(roles.id)">
								编辑
							</button>
							<button type="button" class="btn btn-danger"
								ng-click="remove(roles.id)">
								删除
							</button>
						</td>
					</tr>
					<tr>
						<td colspan="5">
							<my_page></my_page>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
	
	<!--
    	作者：1307455725@qq.com
    	时间：2016-10-24
    	描述：usersRole模态框
    -->
	
	<div class="modal fade" id="roleModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	  <div class="modal-dialog" role="document">
	    <div class="modal-content">
	      		<div class="modal-header" ng-show="addRole" >
		        	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"  ng-click="close()">&times;</span></button>
		        	<h4 class="modal-title" id="myModalLabel">角色添加</h4>
		        </div>
				<div class="modal-header" ng-show="roleRights">
			        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"  ng-click="close()">&times;</span></button>
			        <h4 class="modal-title" id="myModalLabel" >角色权限</h4>
		        </div>
		        <div class="modal-header" ng-show="allotRights">
			        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"  ng-click="close()">&times;</span></button>
			        <h4 class="modal-title" id="myModalLabel" >分配权限</h4>
		        </div>
	      <div class="modal-body" ng-controller="infoRoleAuthCtl">
	      		
	    	<div ng-show="showAllotRights" class="">
	      			<div class="pull-left" style="padding-bottom: 14px; padding-left: 14px;">
	      				<h6 class="pull-left">分配角色：</h6>
	      				<span class="pull-right" style="padding-top: 8px;">{{roleAuth.name}}</span>
	      			</div>
	      		</div>
  				
  				<div ng-show="roleRights">
	      			<table class="table table-hover">
	      				<tr style="text-align: center;">
							<td>权限ID标识</td>
							<td>权限名称</td>
							<td>权限编号</td>
							<td>权限描述</td>
							<td>操作</td>
						</tr>
						<tr ng-repeat="auth in authList" style="text-align: center;">
							<td>{{auth.id}}</td>
							<td>{{auth.name}}</td>
							<td>{{auth.code}}</td>
							<td>{{auth.desc}}</td>
							<td>
								<a ng-show="!auth.exit" class="btn btn-success  active" role="button" style="font-size: 12px;"
									 ng-click="setAllotRights(auth.id)">分配</a>
								<a ng-show="auth.exit" class="btn btn-danger active" role="button" 
									style="font-size: 12px;" ng-click="removeRoleAuth(auth.roleAuthId)">取消分配</a>
							</td> 
						</tr>
						<tr>
						<td colspan="5" style="border-bottom: 1px solid #E0E0E0;">
							<my_pages></my_pages>
						</td>
					</tr>
	      			</table>
	      		</div>
	      		<div ng-show="allotRights" style="margin-top: 48px;">
	      			<form class="form-horizontal" ng-submit="addRoleAuth()" role="roleAuthForm" name="roleAuthForm">
		      			<input type="hidden" ng-model="roleAuth.id" >
		      			<div class="form-group">
		      				<label for="inputUserNaneId" class="col-sm-3 control-label">角色ID</label>
		      				<div class="col-sm-4">
					      	 <p class="form-control-static">{{roleAuth.roleId}}</p>
		      				</div>
		      			</div>
		      			<div class="form-group">
		      				<label for="inputRoleNameId" class="col-sm-3 control-label">权限ID</label>
		      				<div class="col-sm-4">
		      					<p class="form-control-static">{{roleAuth.authId}}</p>
		      				</div>
		      			</div>
		      			<div class="form-group">
						    <label class="col-sm-3 control-label">权限描述</label>
						    <div class="col-sm-6">
						      <textarea class="form-control" rows="3" ng-model="roleAuth.desc" required></textarea>
						    </div>
					  	</div>
					  	<div class="form-group">
						    <label class="col-sm-3 control-label"></label>
						    <div class="col-sm-6">
						         <button type="submit" class="btn btn-primary">保存</button>
						    </div>
					  	</div>

	      			</form>
	      		</div>
  				
  				<div ng-show="addRole">
  					<form class="form-horizontal" ng-submit="submit()" role="form" name="form">
					  <input type="hidden" ng-model="formData.id" >
					  <div class="form-group">
					    <label for="inputjsMc" class="col-sm-3 control-label">角色名称：</label>
					    <div class="col-sm-4">
					      	<input type="text" class="form-control" id="inpujsMC33" ng-model="formData.name" required>
					   </div>
					  </div>
					   <div class="form-group" style="margin-top: 10px;">
						    <label for="inputjsbh3" class="col-sm-3 control-label">角色编号：</label>
						    <div class="col-sm-4">
						      <input type="text" class="form-control" id="inpujsbh3" ng-model="formData.code" required>
						    </div>
					  </div>
					  <div class="form-group">
						    <label class="col-sm-3 control-label">角色描述：</label>
						    <div class="col-sm-6">
						      <textarea class="form-control" rows="3" ng-model="formData.desc" required></textarea>
						    </div>
					  </div>
					  <div class="form-group">
						    <label class="col-sm-3 control-label"></label>
						    <div class="col-sm-6">
						    	
						        <button type="submit" class="btn btn-primary"
						        	ng-disabled="myForm.user.$dirty && myForm.user.$invalid ||
												  myForm.email.$dirty && myForm.email.$invalid">
						        	保存</button>
										      	
						    </div>
					  </div>
					</form>
				</div>
	      </div>
	      <div class="modal-footer">
	      	
	        <button type="button" class="btn btn-danger" data-dismiss="modal" ng-click="close()">关闭</button>
	       
	      </div>
	    </div>
	  </div>
	</div>
	
</div>